#ifndef _STOPANDWAIT_H
#define _STOPANDWAIT_H

#include "xlowpan.h"

#define FAIL_RESET 3
#define FAIL_TIMEOUT 2
#define FAIL_OTHER 1

void Reliable_Init(struct xlowpan_addr64* addr, unsigned char power);

int Reliable_TransmitPacket(struct xlowpan_addr64* to, unsigned char* data, unsigned int length, unsigned int timeout, unsigned int retries);

void Reliable_ReceivePacket(struct xlowpan_addr64* from, unsigned char* data, unsigned int length);

void SAWTimer_ISR(void);

void Reliable_SetReceiveHandler(void(*X)(struct xlowpan_addr64* to, unsigned char* data, unsigned int length));

void Reliable_SetSendHandler(unsigned int (*X)(struct xlowpan_addr64* to, void* data, unsigned int length));

void Reliable_SendTest(void);

#endif